#!/bin/bash
# Edited by Emma Ainsworth, FileWave PS Engineer to check for SentinelOne Profiles

# Profile UUIDs
profile1="7889BE15-9387-4CDD-B2D7-D57B65EDA1E5"
profile2="C957C35F-004C-4CF4-B075-9CAE5739081B"
profile3="0F7D9FAD-1257-402C-A942-354723513881"
profile4="2B752EEE-3A7D-4995-94C2-41532A4479E4"

# Flag to track if all profiles are found
all_found=true

# Check each profile
for profile in "$profile1" "$profile2" "$profile3" "$profile4"; do
    if profiles -P | grep -q "$profile"; then
        echo "Found installed profile: $profile"
    else
        echo "Profile $profile NOT FOUND"
        all_found=false
    fi
done

# Exit depending on whether all profiles were found
if [ "$all_found" = true ]; then
    exit 0
else
    exit 1
fi